<!DOCTYPE html>

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>宽带组 : 删除项目组</title>

  <link href="../../css/bootstrapmin.css" rel="stylesheet" media="screen">
  <link href="../../css/style.css" rel="stylesheet">
<script> 
/*移除左边选中的列表项到右边*/ 
function fMoveSelectedOptionsLeftToRight(oLeft,oRight) 
{ 
if(!(oLeft&&oRight)) 
{ 
return; 
} 
if(!hasOptions(oLeft)) 
{ 
return; 
} 
if(oLeft.selectedIndex==-1) 
{ 
oLeft.selectedIndex=0; 
} 
for(var i=0;i<oLeft.options.length;i++) 
{ 
if(oLeft.options[i].selected) 
{ 
//	var child_op="<option value=\""+oLeft.options[i].value+"\"> "+oLeft.options[i].text+"</option>";
//var oOption = document.createElement("OPTION"); 
//oOption.setAttribute("text",oLeft.options[i].text); 
//oOption.setAttribute("value",oLeft.options[i].value); 
//oRight.add(oOption);	 
	var opt = document.createElement ("option");
    opt.value = oLeft.options[i].value;
    opt.innerText = oLeft.options[i].text;
    oRight.appendChild (opt);
} 
} 
clearSelectedOptions(oLeft); 
} 
/*移除左边的所有列表项到右边*/ 
function fMoveAllOptionsLeftToRight(oLeft,oRight) 
{ 
if(!(oLeft&&oRight)) 
{ 
return; 
} 
if(!hasOptions(oLeft)) 
{ 
return; 
} 
for(var i=0;i<oLeft.options.length;i++) 
{ 
/*
var oOption = document.createElement("OPTION"); 
oOption.setAttribute("text",oLeft.options[i].text); 
oOption.setAttribute("value",oLeft.options[i].value); 
oRight.add(oOption); 
*/
var opt = document.createElement ("option");
    opt.value = oLeft.options[i].value;
    opt.innerText = oLeft.options[i].text;
    oRight.appendChild (opt);
} 
clearAllOptions(oLeft); 
} 
/*移除右边选中的列表项到左边*/ 
function fMoveSelectedOptionsRightToLeft(oLeft,oRight) 
{ 
if(!(oLeft&&oRight)) 
{ 
return; 
} 
if(!hasOptions(oRight)) 
{ 
return; 
} 
if(oRight.selectedIndex==-1) 
{ 
oRight.selectedIndex=0; 
} 
for(var i=0;i<oRight.options.length;i++) 
{ 
if(oRight.options[i].selected) 
{ 
/*
	var oOption = document.createElement("OPTION"); 
oOption.setAttribute("text",oRight.options[i].text); 
oOption.setAttribute("value",oRight.options[i].value); 
oLeft.add(oOption); 
*/
	var opt=document.createElement("OPTION");
	opt.value = oRight.options[i].value;
    opt.innerText = oRight.options[i].text;
	oLeft.appendChild(opt);
	
} 
} 
clearSelectedOptions(oRight); 
} 
/*移除右边的所有列表项到左边*/ 
function fMoveAllOptionsRightToLeft(oLeft,oRight) 
{ 
if(!(oLeft&&oRight)) 
{ 
return; 
} 
if(!hasOptions(oRight)) 
{ 
return; 
} 
for(var i=0;i<oRight.options.length;i++) 
{ 
/*
	var oOption = document.createElement("OPTION"); 
oOption.setAttribute("text",oRight.options[i].text); 
oOption.setAttribute("value",oRight.options[i].value); 
oLeft.add(oOption); 
*/
var opt=document.createElement("OPTION");
	opt.value = oRight.options[i].value;
    opt.innerText = oRight.options[i].text;
	oLeft.appendChild(opt);
} 
clearAllOptions(oRight); 
} 
/*清空select所有options*/ 
function clearAllOptions(oSelect) 
{ 
if(oSelect) 
{ 
var ops=oSelect.options; 
while(ops.length>0) 
{ 
oSelect.remove(ops.length-1); 
} 
} 
} 
/*清空select所有选中的options*/ 
function clearSelectedOptions(oSelect) 
{ 
if(oSelect) 
{ 
for(var i=0;i<oSelect.options.length;i++) 
{ 
if(oSelect.options[i].selected) 
{ 
oSelect.remove(i--); 
} 
} 
} 
} 
/*判断select是否有options*/ 
 function hasOptions(oSelect) 
	{ 
	if(oSelect) 
	{ 
	return oSelect.options.length>0; 
	} 
	return false; 
	} 

function checkForm(){ 
var onRight=document.forms[0].rightItem;
//var hide_value=new array(onRight.options.length);
//alert(hide_value.length);
//alert(onRight.options.length); 
for(var i=0;i<onRight.options.length;i++){ 
var text=onRight.options[i].text; 
var value=onRight.options[i].value; 
document.getElementById("hide_option").value=value;
var hide_value=document.getElementById("hide_option").value;
alert(hide_value);
	}
} 
function sendGroupMembers()
{
	//alert("111");
	//var onRight=document.forms[0].rightItem;
	var onRight=document.form1.rightItem;
	var str="";
	//alert(onRight.options.length);
	//var onRight=document.getElementById('rightItem');
	for(var i=0;i<onRight.options.length;i++){ 
		//alert("1111");
		str+=(onRight.options[i].value+"__"); 
		//alert("str = "+str);
	}
	//alert(onRight.options.length);
	var input_id=document.getElementById('sent_input');
	if(input_id){
		input_id.value=str;
	}
	else{
		//alert("else");
		var tableid=document.getElementById('delete_teams');
		//alert(tableid);
		//alert(tableid.rows.length);
		var newRow=tableid.insertRow();
		//alert("after newRow");
		var col=newRow.insertCell();		
		col.innerHTML="<input type='hidden' name='delete_teams' value='"+str+"' id='sent_input'>";
	}
}
</script> 

<script type="text/javascript" src="../../js/header.js"></script>



  
</head>
<?php
require("header.php");
?>

<!-- end of header -->
 
    <div id= "achievement">
<?php
	require("../../DBops.php");
	session_start();
		if(isset($_SESSION['user'])){
	$con = connect("localhost", "root", "", "lab");
	$result = query($con, "*", "personalinfo", "ID", $_SESSION['user']);
	$row = mysql_fetch_array($result);
	
	
	
		echo "<div style='height:30px;background:#A4D3EE;'>
		      
              <p  style='margin-right:10px;float:right;'>登录为: <a href = \"../../infor.php?id=".$_SESSION['user']."\">".$_SESSION['user']."</a></font>&nbsp&nbsp
			  <a  onclick=\"if(confirm('确定要退出系统吗?')){parent.location.href ='../../logout.php'}\" href=\"javascript:void(0)\">退出</a></font></p></div>";
	}
	else
	{
		echo "<div style='height:30px;background:#A4D3EE;'>
				<ul>
              <li  style='margin-right:10px;float:right;'><a href ='../../login.php'>登录</a></div>";
	}
	

?>
 
                    <!-- TOC START -->
					<?php
					
					$con = connect("localhost", "root", "", "lab");
					
echo"
<br/>
<p><strong>&nbsp;&nbsp;&nbsp;项目组删 除</strong></p>

<form name='form1' method='post' runat='server' action='saveDelete.php'> 
<table border='0' align='center' width='85%' cellspacing='0' cellpadding='0'> 
<tr> 
<td> 
<table border='0' align='center' id='delete_teams'> 
<tr> 
<td> 
&nbsp;&nbsp;&nbsp;<select name='leftItem' style='width:200px' size='10' multiple='multiple' > ";
	
	$result =mysql_query( "SELECT * FROM  projecteam ");
	
	
	
	while($row=mysql_fetch_array($result)){
		if($row['name'])
		{
			echo"<option value='".$row['ID']."'>".$row['name']."</option>";
			
		}
	}
	
	echo"</select>";
?>

</td> 
</tr> 
</table> 
</td> 
<td> 
<table border="0" align="center"> 
<tr><td height="30"><input type="button" name="button1" style="width:50px" value=">" onClick="fMoveSelectedOptionsLeftToRight(document.all.leftItem,document.all.rightItem)"></td></tr> 
<tr><td height="30"><input type="button" name="button2" style="width:50px" value=">>" 
onClick="fMoveAllOptionsLeftToRight(document.all.leftItem,document.all.rightItem)"></td></tr> 
<tr><td height="30"><input type="button" name="button3" style="width:50px" value="<" 
onClick="fMoveSelectedOptionsRightToLeft(document.all.leftItem,document.all.rightItem)"></td></tr> 
<tr><td height="30"><input type="button" name="button4" style="width:50px" value="<<" 
onClick="fMoveAllOptionsRightToLeft(document.all.leftItem,document.all.rightItem)"></td></tr> 
</table> 
</td> 
<td> 
<table border="0" align="center" id="selected_members"> 
<tr> 
<td> 

<select name="rightItem" style="width:200px" size="10" multiple="multiple" id="rightItem" > 
	</select>

</td> 
</tr> 
</table> 
</td> 
</tr> 
</table> 
<table border="0" align="center"> 
<tr height="40"> 
<td>
<input type="hidden" name="hide_option" id="hide_option" value="">
<input type="hidden" name="hide_length" id="hide_length" value="">

&nbsp;&nbsp;&nbsp;<input type="submit" value="确认删除" onClick="sendGroupMembers();"></td> 
</tr> 
</table> 
</form> 
</div>
</body>
</html>